@extends('template.template')
@section('menu')
<ul>
		@if(!empty($mon_hoc) && $mon_hoc->count()>0)
			 @foreach ($mon_hoc as $mon)
			 	<li><a href="#{{$mon->TAG_ID}}">{{ $mon->TEN_MON}}</a></li>
			 @endforeach
		@endif 
</ul>
@stop
@section('container')	
	<!-- begin foreach -->
			@if(!empty($mon_hoc) && $mon_hoc->count()>0)
					 @foreach ($mon_hoc as $mon)
					 	<div id="category">	
					 		<div id="container-footer">
								<p>Chỉnh sửa cuối cùng: {{ date("(H:i - d/m/Y)",strtotime($mon->created_at)) }} </p>
							</div>
							<h4 id="{{$mon->TAG_ID}}">{{ $mon->TEN_MON}}</h4>
							<span id="TOP"><a href="#wrapper">LÊN ĐẦU</a></span>	
						<div class="clear"></div>	
						<hr>
							<!-- Lấy các chương có parent_id là --> 
							@foreach ($chuongs as $chuong)							
								@if( $chuong->PARENT_ID ==$mon->ID)
									@if($chuong->IN_DAM_CHUONG == 1)
										<h5>{{$chuong->TEN_MON}}</h5>
									@else	
										@if(!empty($chuong->GHICHU_ALIAS))					
											{{link_to_route('ghichu.show', $chuong->TEN_MON, $chuong->GHICHU_ALIAS, array('class' => 'a')) }} <br>
										@else
											{{link_to_route('ghichu.show', $chuong->TEN_MON, 'chua-co', array('class' => 'a')) }} <br>
										@endif	
									@endif 
								@endif 
					  		@endforeach							
						</div>	
				    @endforeach
				@endif 
	<!-- end foreach -->
@stop